<template>
<div id="showMobilePrediv" @click="handleClose">
  <div class="contents">
    <div class='mobile_prediv_header'><i class='mobile_prediv_header_icon'></i></div>
    <div class='mobile_prediv_frame'>
      <div class="swiper">
        <el-carousel>
          <el-carousel-item v-for="(item, index) in formData.photos" :key="index">
            <div class="imgDiv" :style="{
                  background: 'url(' + setPredivUrl(item) + ')',
                  backgroundSize: 'cover',
                  backgroundPosition: 'center',
                }"></div>
          </el-carousel-item>
        </el-carousel>
      </div>
      <div class="intro">
        <div class="infoWrap">
          <div class="itemBox title mt8">
            {{formData.groundName}}
          </div>
          <div class="itemBox">
            开放时间：{{formData.openTime}}
          </div>
          <div class="itemBox">
            容纳人数：{{formData.capacity}}人
          </div>
          <div class="itemBox">
            <div class="left">咨询电话：</div>
            <div class="center">{{formData.tel}}</div>
            <div class="right">
              <el-tag class="tagPadding">
                <i class="el-icon-phone"></i>
                <span class="ml4">电话</span>
              </el-tag>
            </div>
          </div>
          <div class="itemBox">
            <div class="left">联系地址：</div>
            <div class="center">{{formData.address}}</div>
            <div class="right">

              <el-tag class="tagPadding">
                <i class="el-icon-location-outline"></i><span class="ml4">导航</span>
              </el-tag>
            </div>
          </div>
        </div>
      </div>
      <div class="space"></div>
      <div class="tab">
        <el-tabs v-model="active" @tab-click @click.native.stop>
          <el-tab-pane label="阵地简介" name="1">
            <div v-html="formData.intro" class="richText"></div>
          </el-tab-pane>
          <el-tab-pane label="品牌项目" name="2">
            <div v-html="formData.specialProjectIntro" class="richText"></div>
          </el-tab-pane>
          <el-tab-pane label="志愿活动" name="3"></el-tab-pane>
          <el-tab-pane label="实践资讯" name="4"></el-tab-pane>
        </el-tabs>
      </div>
    </div>
    <div class='mobile_prediv_footer'><i class='mobile_prediv_footer_icon'></i></div>
  </div>
</div>
</template>
<script>
import projectConfig from '@/core/config';
export default {
  name: "",
  props: {
    formData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      active: '1'
    }
  },
  methods: {
    setPredivUrl(item) {
      return (
        projectConfig.baseUrl +
        "admin/upms/file/download?filename=" +
        item
      );
    },
    handleClose() {
      this.$emit('handleClose')
    },
  }
}
</script>
<style lang="scss" scoped>
#showMobilePrediv {
    z-index: 9999;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    .contents {
        position: absolute;
        width: 387px;
        height: 768px;
        border-radius: 50px;
        left: calc((100% - 387px) / 2);
        top: calc((100% - 768px) / 2);
        z-index: 20000;
    }

}
.mobile_prediv_header {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    height: 40px;
    width: 387px;
    background: #eeeff2;
    text-align: center;
    line-height: 40px;
    border-top-right-radius: 50px;
    border-top-left-radius: 50px;
}
.mobile_prediv_header_icon {
    display: inline-block;
    width: 65px;
    height: 10px;
    background: #c8c9cc;
    border-radius: 9px;
    vertical-align: middle;
    margin-top: 18px;
}
.mobile_prediv_frame {
    width: 387px;
    min-height: 677px;
    height: 677px;
    top: 40px;
    left: 0;
    position: relative;
    background-color: #fff;
    display: block;
    overflow-y: scroll;
}
.mobile_prediv_footer {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    height: 52px;
    width: 387px;
    background: #eeeff2;
    text-align: center;
    line-height: 45px;
    border-bottom-right-radius: 50px;
    border-bottom-left-radius: 50px;
}

.mobile_prediv_footer_icon {
    display: inline-block;
    width: 43px;
    height: 43px;
    background: #c8c9cc;
    border-radius: 50%;
    vertical-align: middle;
}
.row {
    display: flex;
    justify-content: space-between;
}
:deep(.my-swipe .van-swipe-item) {
    color: #fff;
    text-align: center;
    position: relative;
    width: 387px;
    height: 0;
    padding-bottom: 218px;
}
.imgDiv {
    position: absolute;
    width: 387px;
    height: 218px;
    top: 0;
    left: 0;
    display: inline-block;
}
:deep(.tagPadding.van-tag) {
    padding: 3px 5px;
    background-color: #f7f8fa;
}
:deep(.van-cell__title .detail) {
    display: inline-block;
    // text-overflow: ellipsis;
    // white-space: nowrap;
    // overflow: hidden;
}
.space {
    width: 100%;
    height: 10px;
    background-color: #f6f8f9;
}
.infoWrap {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    padding: 5px 10px;
    box-sizing: border-box;
    font-size: 14px;
    .title {
        font-size: 16px;
        font-weight: 600;
    }
    .itemBox {
        border-bottom: 1px solid #e8e8eb;
        padding: 10px 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        .center {
            flex: 1;
        }
    }
}
.richText {
    text-indent: 2em;
    line-height: 24px;
    color: #606266;
    padding: 5px 10px;
}
::-webkit-scrollbar {
    display: none;
}
:deep(.swiper .el-carousel__container) {
    height: 218px;
}
.tab {
    padding: 0 10px;
}
:deep(.el-tabs__header.is-top) {
    margin-bottom: 0;
}
:deep(.el-tag) {
    height: 23px;
    line-height: 22px;
    background-color: #f7f8fa;
    border-color: #1989fa;
    border-radius: 2px;
    padding: 0 5px;
}
</style>
